<template>
  <div>
    <created @handlePlan="handlePlan"></created>
  </div>
</template>
<script>
  import Created from './create'
  import { useStore } from 'vuex'
  import * as types from '../../store/action'
  import { message } from 'ant-design-vue'
  export default {
    components: { Created },
    setup (props, context) {
      const store = useStore()
      const handlePlan = async plan => {
        await store.dispatch(types.ADD_PLAN, plan)
        message.success('操作成功')
      }
      return {
        handlePlan
      }
    }
  }
</script>